<?php

namespace app\models\tableModel\base;

use Yii;

/**
 * This is the model class for table "{{%admin_user}}".
 *
 * @property string $id
 * @property string $user_name 账号
 * @property string $nick_name 昵称
 * @property string $salt
 * @property string $password_hash
 * @property int $status 状态
 * @property int $add_time 添加时间
 * @property int $update_time 修改时间
 * @property string $avatar 头像
 * @property string $role_id 角色编号
 */
class AdminUser extends Base
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%admin_user}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['status', 'add_time', 'update_time'], 'integer'],
            [['id'], 'string', 'max' => 24],
            [['user_name'], 'string', 'max' => 12],
            [['nick_name'], 'string', 'max' => 100],
            [['salt', 'password_hash', 'avatar'], 'string', 'max' => 255],
            [['role_id'], 'string', 'max' => 32],
            [['id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_name' => '账号',
            'nick_name' => '昵称',
            'salt' => 'Salt',
            'password_hash' => 'Password Hash',
            'status' => '状态',
            'add_time' => '添加时间',
            'update_time' => '修改时间',
            'avatar' => '头像',
            'role_id' => '角色编号',
        ];
    }
}
